package fr.web325.servlet.client.login;


import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.*;
import java.io.IOException;

@WebServlet("/shop/client/loginOut")
public class LoginOutServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        HttpSession session = req.getSession();
        // 清空自动登录的cookie
        resp.addCookie(new Cookie("autoLogin",null));
        session.removeAttribute("user");
        req.getRequestDispatcher("/shop").forward(req,resp);
    }
}
